package com.yc.chaoshi.cs_manage;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.yc.chaoshi.cs_manage.Interceptor.LoginInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
@EnableRedisHttpSession
@Configuration
@MapperScan({"com.yc.chaoshi.cs_manage.mapper"})
public class CsManageApplication implements WebMvcConfigurer {
    public CsManageApplication() {
    }
    public static void main(String[] args) {
        SpringApplication.run(CsManageApplication.class, args);
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册自己的拦截器,并设置拦截的请求路径
        //addPathPatterns为拦截此请求路径的请求
        //excludePathPatterns为不拦截此路径的请求
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/umsRoles/list");
    }
}
